<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- InstanceBeginEditable name="doctitle" -->
<title>TCedit 测试用例编写工具 - 测试用例编写</title>
<!-- InstanceEndEditable -->
<link rel="shortcut icon" href="favicon.ico">
<script src="/js/common.js"></script>
<script src="/js/jquery/jquery.js"></script>
<script type="text/javascript" src="/js/ckeditor/ckeditor.js"></script>
<script src="/js/ckeditor/TCedit.js" type="text/javascript"></script>
<link href="/js/ckeditor/TCedit.css" rel="stylesheet" type="text/css" />
<link href="/css/common.css" rel="stylesheet" type="text/css">
<script language="javascript">
#if($refreshTree == "create")
  #if($testCase.catalogID==$ROOT_ID)
    pid="-1";
  #else
    pid="#"+"$!{testCase.catalogID}";
  #end
  opener.parent.leftFrame.createTreeNode(pid, "$!{testCase.id}", "file", "$!{testCase.describing}");  
#elseif($refreshTree == "delete")
  parent.leftFrame.deleteTreeNode(getParam("id"));
#elseif($refreshTree == "update")
  #if($testCase.catalogID==$ROOT_ID)
    pid="-1";
  #else
    pid="#"+"$!{testCase.catalogID}";
  #end
  opener.parent.leftFrame.updateTreeNode(pid, "$!{testCase.id}", "$!{testCase.describing}");
#end
#if($close)
  window.close();
#end

function doAction(action){
  if (action == "create") {
    document.formData.action = "/testCaseMgt/testCaseForm.jspx?action=create";
  } else if (action == "update") {
    document.formData.action = "/testCaseMgt/testCaseForm.jspx?action=update&id=${testCase.id}";
  } else if (action == "chooseCatalog") {
    window.open("/chooseCatalog.html?pid=" + $("#parentCatalogID").attr("value"), "", "width=" + window.screen.width*0.30 + ",height=450,left="+ window.screen.width*0.35 + ",top=" + (window.screen.height-450)/2 + ",toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no");
    return false;
  }
}
</script>
<script type="text/javascript">
	var editor, html = '';

	function createEditor() {
		if ( editor ) {
			return;
		}
		var config = {};
		editor = CKEDITOR.appendTo( 'editor', config, html );
		editor.mode == 'wysiwyg';
	}
</script>
<script>
function checkForm(){
	if($("#describing").attr("value")==""){
		alert("请输入“用例描述”！");
		return false;
	}

	return true;
}
function setParentCatalog(pID, pName) {
	$("#parentCatalogID").attr("value", pID);
	$("#parentCatalogName").attr("value", pName);
}

</script>
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>

<body>
<table width="99%" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" valign="top">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td></td>
          <td>
            #if($error)
              <font color="#FF0000">$error</font>
            #end
          </td>
        </tr>
        <form action="" method="post" enctype="multipart/form-data" name="formData" id="formData" onSubmit="return checkForm()">
        <tr>
          <td width="15%" align="right">父分类名称：</td>
          <td width="85%">
            <input name="parentCatalogName" type="text" id="parentCatalogName" style="width:50%;" maxlength="50" value="$!{parentCatalog.name}" disabled/>
            <input name="chooseCatalog" id="chooseCatalog" type="image" value="" src="../images/choose.bmp" onClick="return doAction('chooseCatalog')" />
            <input name="parentCatalogID" type="hidden" id="parentCatalogID" value="$!{parentCatalog.id}" />
          </td>
        </tr>
        <tr>
          <td align="right">用例描述：</td>
          <td><input name="describing" type="text" class="text" id="describing" style="width:95%;" maxlength="50" value="$!{testCase.describing}" /> <b><font color="#FF0000">*</font></b></td>
        </tr>
        <tr>
          <td align="right">前提和约束：</td>
          <td><input name="premiss" type="text" class="text" id="premiss" style="width:95%;" maxlength="100" value="$!{testCase.premiss}" /></td>
        </tr>
        <tr>
          <td align="right">备注：</td>
          <td><input name="remark" type="text" class="text" id="remark" style="width:95%;" maxlength="100" value="$!{testCase.remark}" /></td>
        </tr>
        <tr>
          <td align="right">状态：</td>
          <td>
            <select style="width:20%;" name="caseStateID" id="caseStateID">
#foreach($a in $caseStates)
              <option value ="$!{a.id}"
                #if($a.id==$testCase.caseState.id)
                  selected
                #end
              >$!{a.name}</option>
#end
            </select>
          </td>
        </tr>
        <tr>
          <td align="right">操作步骤：</td>
          <td>
            <textarea id="stepsStr" name="stepsStr">$!{testCase.stepsStr}</textarea>
<script type="text/javascript">
	CKEDITOR.replace( 'stepsStr', {
		removePlugins : 'elementspath', // 去除element路径显示
		resize_enabled : false, // 去除窗口大小调整功能，移除状态栏
		startupOutlineBlocks : false, // 载入时，是否显示框体的边框
		height : (document.body.clientHeight-270)*0.75,
		toolbar : [
				{ name: 'items', items : [ 'PasteText','-','Undo','Redo',
										'Find','-','RemoveFormat','Table',
										'HorizontalRule',
										'NumberedList','BulletedList',
										'Bold','Italic','Underline',
										'Font','FontSize','TextColor','BGColor','Source'] },
				{ name: 'styles', items : [  ] }
		]
	} );
</script>
          </td>
        </tr>
        <tr>
          <td align="right">预期结果：</td>
          <td>
            <textarea id="exResultStr" name="exResultStr">$!{testCase.exResultStr}</textarea>
<script type="text/javascript">
	CKEDITOR.replace( 'exResultStr', {
		removePlugins : 'elementspath', // 去除element路径显示
		resize_enabled : false, // 去除窗口大小调整功能，移除状态栏
		startupOutlineBlocks : false, // 载入时，是否显示框体的边框
		height : (document.body.clientHeight-270)*0.25,
		toolbar : [
				{ name: 'items', items : [ 'PasteText','-','Undo','Redo',
										'Find','-','RemoveFormat','Table',
										'HorizontalRule',
										'NumberedList','BulletedList',
										'Bold','Italic','Underline',
										'Font','FontSize','TextColor','BGColor','Source'] },
				{ name: 'styles', items : [  ] }
		]
	} );
</script>
          </td>
        </tr>
        <tr>
          <td height="7px"></td>
          <td></td>
        </tr>
        <tr>
          <td></td>
          <td>
            #if($action=="" || $action=="create")
              <input name="SubmitCreate" type="submit" class="button" id="SubmitCreate" value="新增" onClick="doAction('create')" />
            #else
              #if (!($action=="delete"))
                <input name="SubmitUpdate" type="submit" class="button" id="SubmitUpdate" value="修改" onClick="doAction('update')" />
              #end
            #end
          </td>
          <td></td>
          <td></td>
        </tr>
        </form>
      </table>
    </td>
  </tr>
</table>
</body>
<!-- InstanceEnd -->
</html>